package com.quanyan.orderpay.service;

import com.quanyan.alipay.protocal.AliPayBatchTransNotifyData;
import com.quanyan.api.APIResponse;
import com.quanyan.common.Plugin.PageObj;
import com.quanyan.order.entity.Order;
import com.quanyan.orderpay.entity.PaySuccessData;
import com.quanyan.orderpay.request.ReqBatchWithdrawQuery;
import com.quanyan.orderpay.request.WithdrawPayInfo;
import com.quanyan.orderpay.response.RespBatchWithdraw;
import com.quanyan.orderpay.response.RespWithdrawApply;
import com.quanyan.orderpay.response.mq.WithdrawTransferNotify;
import com.quanyan.pay.entity.RefundCompleteData;

import java.text.ParseException;
import java.util.List;

/**
 * 订单支付成功后处理
 *
 * @author songzj
 * @date 16/6/7-15:40
 */
public interface OrderProcessService {


    /**
     * 支付成功处理
     *
     * @param paySuccessData
     * @return
     */
    boolean paySuccess(PaySuccessData paySuccessData);

    /**
     * 退款结束处理
     *
     * @return
     */
    boolean refundComplateProcess();

    /**
     * 退款完成处理
     *
     * @param refundCompleteData
     * @return
     */
    boolean refundComplateProcess(RefundCompleteData refundCompleteData);

    /**
     * 提现付款，支付宝
     *
     * @param notifyData
     * @return
     */
    boolean withdrawCompleteProccess(AliPayBatchTransNotifyData notifyData);

    void orderMqResend();

    /**
     * 关闭超时订单
     */
    void closeTimeOutOrder();

    void withdrawReset();

    void unfrezenUserAssest(Order order, String fail);

    /**
     * 刷新accessToken
     */
    void refreshAccessToken();

    void orderQuery();

    void callBackSacnPayResend();

    /**
     * 用户提现，调用微信企业支付接口打款给用户
     */
    void transferFundByWechat(WithdrawPayInfo payInfo);

    APIResponse<PageObj<List<RespBatchWithdraw>>> batchWithdrawQuery(ReqBatchWithdrawQuery reqBatchWithdrawQuery) throws ParseException;

    APIResponse<List<RespWithdrawApply>> getApplyByBatchNo(String batchNo);

    void callBackByWithdraw(WithdrawTransferNotify notifyDetail, String source);


    void scanPay();
}
